<template>
  <div class="Fooddiets">
    <div class="center">
      <div class="yyuan">
        <div class="yyleft">
          <ul class="entitle">
            <li>药</li>
            <li>膳</li>
            <li>食</li>
            <li>疗</li>
          </ul>
          <p class="flower"><img src="../assets/flower.png" /></p>
          <div class="dangjian">
            <div class="art" v-for="(item, index) in details" :key="index">
              <router-link
                :to="{ name: 'Fooddiet_pro', params: { id: item.id } }"
              >
                <div class="artimg"><img :src="item.thumb" alt="" /></div>
                <div class="artright">
                  <p class="artitle">{{ item.title }}</p>
                  <p class="text">
                    {{ item.content }}
                  </p>
                  <p class="content">
                    <span>{{ item.hits }}阅读</span>
                    <span>{{ item.ctime }}</span>
                  </p>
                </div>
              </router-link>
            </div>
          </div>
          <p class="flower"><img src="../assets/flower.png" /></p>
          <div class="page">
            <Page></Page>
          </div>
        </div>
        <div class="yyright">
          <Hotright></Hotright>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
import Page from "@/components/paging.vue";
import Hotright from "@/components/Hotright.vue";
export default {
  name: "Fooddiets",
  components: {
    Page,
    Hotright,
  },
  data: function() {
    return {
      details: [
        // {
        //   url:'Fooddiet_pro',
        //   image: require("../assets/yaoshan.png"),
        //   title: "推荐两种泽泻的食用方法有清热祛湿的功效!",
        //   text:
        //     "泽泻是一种传统的中药材，对于利尿效果非常不错，尤其是搭配各种其他种类的中药治病效果更佳，下面给...",
        //   span: "149阅读",
        //   time: "2020-11-21",
        // },
        // {
        //   url:'Fooddiet_pro',
        //   image: require("../assets/yaoshan.png"),
        //   title: "推荐两种泽泻的食用方法有清热祛湿的功效!",
        //   text:
        //     "泽泻是一种传统的中药材，对于利尿效果非常不错，尤其是搭配各种其他种类的中药治病效果更佳，下面给...",
        //   span: "149阅读",
        //   time: "2020-11-21",
        // },
        // {
        //   url:'Fooddiet_pro',
        //   image: require("../assets/yaoshan.png"),
        //   title: "推荐两种泽泻的食用方法有清热祛湿的功效!",
        //   text:
        //     "泽泻是一种传统的中药材，对于利尿效果非常不错，尤其是搭配各种其他种类的中药治病效果更佳，下面给...",
        //   span: "149阅读",
        //   time: "2020-11-21",
        // },
        // {
        //   url:'Fooddiet_pro',
        //   image: require("../assets/yaoshan.png"),
        //   title: "推荐两种泽泻的食用方法有清热祛湿的功效!",
        //   text:
        //     "泽泻是一种传统的中药材，对于利尿效果非常不错，尤其是搭配各种其他种类的中药治病效果更佳，下面给...",
        //   span: "149阅读",
        //   time: "2020-11-21",
        // },
        // {
        //   url:'Fooddiet_pro',
        //   image: require("../assets/yaoshan.png"),
        //   title: "推荐两种泽泻的食用方法有清热祛湿的功效!",
        //   text:
        //     "泽泻是一种传统的中药材，对于利尿效果非常不错，尤其是搭配各种其他种类的中药治病效果更佳，下面给...",
        //   span: "149阅读",
        //   time: "2020-11-21",
        // },
      ],
    };
  },
  created() {
    axios.get("/complex/yaoshanlb").then((res) => {
      this.details = res.data.data;
      // console.log(this.res);
    });
    // .catch((err) => {
    // console.error(err);
    // });
  },
};
</script>

<style scoped>
.Fooddiets {
  width: 100%;
  padding-top: 2rem;
  background-color: #fce7d7;
}
.entitle {
  width: 32%;
  text-align: center;
  margin: 1rem auto;
  overflow: hidden;
}
.entitle li {
  float: left;
  width: 70px;
  height: 70px;
  line-height: 70px;
  background-color: #a40100;
  text-align: center;
  font-size: 38px;
  font-family: "楷体";
  color: #fff;
  border-radius: 40px;
  margin-right: 10px;
}
.dangjian {
  width: 90%;
  margin: 0 auto;
}
.dangjian .art {
  width: 94%;
  margin: 0.5rem auto;
  /* padding-bottom: 1rem; */
  display: flex;
  justify-content: space-between;
}
.dangjian .art a {
  width: 100%;
  /* padding-bottom: 1rem; */
  display: flex;
  justify-content: space-between;
}
.dangjian .art:not(:last-child) {
  border-bottom: 2px solid #a40000;
}
.art .artimg {
  width: 25%;
  padding: 1.5rem 0;
}
.art .artimg img {
  float: left;
  width: 320px;
  height: 220px;
  padding: 0.5rem 0;
  transition: all 0.6s;
}
.art:hover .artimg img {
  float: left;
  /* width: 386px; */
  /* height: 262px; */
  transform: scale(1.1);
  padding: 0.5rem 0;
}
.art .artright {
  width: 63%;
  margin-top: 3rem;
}
.art .artright .artitle {
  color: #a40000;
  font-size: 24px;
  font-weight: 600;
  margin: 1rem 0;
  width: 99%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.art:hover .artright .artitle {
  font-size: 26px;
}
.art .text {
  font-size: 20px;
  color: #676666;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /*! autoprefixer: off */
  -webkit-box-orient: vertical;
  line-height: 2rem;
}
.art:hover .artright .text {
  font-size: 22px;
}
.art .content {
  font-size: 18px;
  color: #676666;
  margin: 1rem 0;
}
.art:hover .artright .content {
  font-size: 20px;
}
.art .content span {
  padding-right: 20px;
}
.yyuan {
  width: 100%;
  padding-left: 3%;
  padding-bottom: 4rem;
  display: flex;
  justify-content: space-between;
  margin-top: 102px;
}
.yyuan .yyleft {
  width: 65%;
  /* border: 1px solid #f00; */
}
.yyuan .yyright {
  width: 25%;
  margin-top: 3rem;
}
.qfpublic {
  width: 450px;
}
.qfpublic p {
  color: #a70b0a;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 30px;
}
.welfare {
  width: 100%;
}
.welfare .weimg {
  width: 92%;
}
.weimg img {
  display: block;
  width: 100%;
}
.weltul {
  margin-top: 2rem;
}
.weltul .link {
  font-size: 18px;
  color: #666666;
}
.weltul li {
  margin-top: 15px;
  display: flex;
  align-items: center;
  height: 30px;
  color: #757371;
}
.weltul li .link:hover {
  color: #a40000;
  font-size: 22px;
  font-weight: 600;
}
.span {
  width: 18px;
  height: 18px;
  background-color: #a40000;
  border-radius: 9px;
  margin: 0 10px;
}
.more {
  background-color: #a40100;
  white-space: nowrap;
  border-radius: 25px;
  text-align: center;
  font-size: 18px;
  letter-spacing: 1px;
  width: 114px;
  padding: 10px 0;
  margin-top: 20px;
  float: right;
  margin-right: 8%;
}
.mlink {
  color: white;
}

/* 右边 */
.content_right {
  width: 846px;
  margin: 0 auto;
}
.right_title_div div {
  width: 70px;
  line-height: 70px;
  background-color: #a40100;
  text-align: center;
  font-size: 38px;
  font-family: "楷体";
  color: white;
  border-radius: 35px;
  margin-left: 10px;
}
.content_right_div {
  height: 132px;
  width: 832px;
  position: relative;
  width: 100%;
  margin-bottom: 50px;
}
.content_right_option {
  display: flex;
  flex-direction: row;
  padding: 5px 10px;
  border: 3px #882e13 solid;
  border-radius: 10px;
  width: 800px;
  transition: all 0.1s;
  position: absolute;
  right: 0;
  /* margin-top: 1rem; */
}
.right_time {
  display: flex;
  flex-direction: column;
  width: 200px;
  margin-right: 40px;
  text-align: center;
  /* background-color: #d06464; */
  color: white;
  font-size: 20px;
  padding: 20px 0;
}
.right_time img {
  display: block;
  width: 100%;
}
.content_right_option:hover {
  width: 846px;
  height: 140px;
}
.new_title {
  font-size: 20px;
  font-weight: 600;
  color: #ac0001;
  margin-top: 20px;
}
.new_details {
  color: gray;
  margin-top: 10px;
}
.content_right_option:hover .right_time {
  width: 250px;
  background: url("../assets/yixun.png") no-repeat 100% 100%;
  /* background-color: #9e290b; */
}
.content_right_option:hover .new_title {
  font-size: 23px;
}
.content_right_option:hover .new_details {
  font-size: 18px;
}
</style>
